package com.zhc.dejingapi.controller;


import com.github.pagehelper.PageInfo;
import com.zhc.dejingapi.common.result.Result;
import com.zhc.dejingapi.entity.query.CodeQuery;
import com.zhc.dejingapi.entity.vo.Code2Vo;
import com.zhc.dejingapi.entity.vo.QingInjectAndSendWorkVo;
import com.zhc.dejingapi.service.QingWithdrawalofpipereportService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

/**
 * <p>
 * 注塑报工表 前端控制器
 * </p>
 *
 * @author zhc
 * @since 2024-10-18
 */
@RestController
@RequestMapping("/qing-withdrawalofpipereport")
@CrossOrigin
public class QingWithdrawalofpipereportController {

    @Resource
    private QingWithdrawalofpipereportService qingWithdrawalofpipereportService;
    @PostMapping("/reportWithdrawalofpipeJob")
    public Result reportWithdrawalofpipeJob(@RequestBody QingInjectAndSendWorkVo qingInjectAndSendWorkVo){
        return qingWithdrawalofpipereportService.reportWithdrawalofpipeJob(qingInjectAndSendWorkVo);

    }

    @PostMapping("/getCodeList")
    private Map<Object, Object> getCodeList(@RequestBody CodeQuery codeQuery){
        PageInfo<Code2Vo> page = qingWithdrawalofpipereportService.getCodeList(codeQuery);
        Map<Object, Object> map = new HashMap<>();
        map.put("records",page.getList());
        map.put("total",page.getTotal());
        return  map;
    }
}
